﻿// MT456




using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category4
{
  public class MT456 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagChoiceDefinition U0004;
    private static SwiftTagDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagDefinition U0013;
    private static SwiftTagSequenceDefinition U0014;
    private static SwiftTagDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagChoiceDefinition U0019;
    private static SwiftTagDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;
    private static SwiftTagSubItemDefinition U001C;
    private static SwiftTagSubItemDefinition U001D;
    private static SwiftTagDefinition U001E;
    private static SwiftTagSubItemDefinition U001F;
    private static SwiftTagSubItemDefinition U007F;
    private static SwiftTagDefinition U0080;
    private static SwiftTagSubItemDefinition U0081;
    private static SwiftTagSubItemDefinition U0082;
    private static SwiftTagSubItemDefinition U0083;
    private static SwiftTagDefinition U0084;
    private static SwiftTagDefinition U0086;
    private static SwiftTagDefinition U0087;
    private static SwiftTagDefinition U0088;

    [Description("Account Identification")]
    public Tag25 AccountIdentification_25
    {
      get
      {
        return new Tag25((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0002);
      }
    }

    [Description("Account Identification")]
    public Tag25 Tag25_AccountIdentification
    {
      get
      {
        return this.AccountIdentification_25;
      }
    }

    [Description("Sender Of Cash Letter")]
    public Tag52A SenderOfCashLetter_52A
    {
      get
      {
        return new Tag52A((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0005);
      }
    }

    [Description("Sender Of Cash Letter")]
    public Tag52A Tag52A_SenderOfCashLetter
    {
      get
      {
        return this.SenderOfCashLetter_52A;
      }
    }

    [Description("Sender Of Cash Letter")]
    public Tag52B SenderOfCashLetter_52B
    {
      get
      {
        return new Tag52B((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0008);
      }
    }

    [Description("Sender Of Cash Letter")]
    public Tag52B Tag52B_SenderOfCashLetter
    {
      get
      {
        return this.SenderOfCashLetter_52B;
      }
    }

    [Description("Sender Of Cash Letter")]
    public Tag52D SenderOfCashLetter_52D
    {
      get
      {
        return new Tag52D((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0010);
      }
    }

    [Description("Sender Of Cash Letter")]
    public Tag52D Tag52D_SenderOfCashLetter
    {
      get
      {
        return this.SenderOfCashLetter_52D;
      }
    }

    [Description("Sender To Receiver Information")]
    public Tag72 SenderToReceiverInformation_72
    {
      get
      {
        return new Tag72((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0013);
      }
    }

    [Description("Sender To Receiver Information")]
    public Tag72 Tag72_SenderToReceiverInformation
    {
      get
      {
        return this.SenderToReceiverInformation_72;
      }
    }

    [Description("Transaction Reference Number")]
    public MT456.SequenceClass[] Sequence
    {
      get
      {
        int index = -1;
        List<MT456.SequenceClass> list = new List<MT456.SequenceClass>();
        int count;
        do
        {
          ++index;
          MT456.SequenceClass sequenceClass = new MT456.SequenceClass((SwiftElement) this, index, false);
          count = this.ListTags((SwiftElement) sequenceClass).Count;
          if (count > 0)
            list.Add(sequenceClass);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    public MT456()
      : base(true)
    {
    }

    public MT456(SwiftMessage message)
      : base(message)
    {
    }

    public MT456.SequenceClass AddSequence()
    {
      return new MT456.SequenceClass((SwiftElement) this, this.Sequence.Length, true);
    }

    public void RemoveSequence(MT456.SequenceClass sequence)
    {
      foreach (SwiftTag tag in this.ListTags((SwiftElement) sequence))
        this.RemoveTag(tag);
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT456.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT456.MessageDefinition = new SwiftMessageDefinition("MT456", "Advice of Dishonour");
      MT456.U0002 = new SwiftTagDefinition("AccountIdentification_25", "Account Identification");
      MT456.U0002.TagName = ":25:";
      MT456.U0002.Mandatory = false;
      MT456.U0003 = new SwiftTagSubItemDefinition("AccountIdentification", "Account Identification");
      MT456.U0002.Elements.Add((SwiftDefinitionElement) MT456.U0003);
      MT456.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT456.U0002);
      MT456.U0004 = new SwiftTagChoiceDefinition("Choice", "");
      MT456.U0004.Mandatory = false;
      MT456.U0004.Multiple = true;
      MT456.U0005 = new SwiftTagDefinition("SenderOfCashLetter_52A", "Sender Of Cash Letter");
      MT456.U0005.TagName = ":52A:";
      MT456.U0006 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT456.U0006.Mandatory = false;
      MT456.U0005.Elements.Add((SwiftDefinitionElement) MT456.U0006);
      MT456.U0007 = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT456.U0005.Elements.Add((SwiftDefinitionElement) MT456.U0007);
      MT456.U0004.Elements.Add((SwiftDefinitionElement) MT456.U0005);
      MT456.U0008 = new SwiftTagDefinition("SenderOfCashLetter_52B", "Sender Of Cash Letter");
      MT456.U0008.TagName = ":52B:";
      MT456.U000E = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT456.U000E.Mandatory = false;
      MT456.U0008.Elements.Add((SwiftDefinitionElement) MT456.U000E);
      MT456.U000F = new SwiftTagSubItemDefinition("Location", "Location");
      MT456.U000F.Mandatory = false;
      MT456.U0008.Elements.Add((SwiftDefinitionElement) MT456.U000F);
      MT456.U0004.Elements.Add((SwiftDefinitionElement) MT456.U0008);
      MT456.U0010 = new SwiftTagDefinition("SenderOfCashLetter_52D", "Sender Of Cash Letter");
      MT456.U0010.TagName = ":52D:";
      MT456.U0011 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT456.U0011.Mandatory = false;
      MT456.U0010.Elements.Add((SwiftDefinitionElement) MT456.U0011);
      MT456.U0012 = new SwiftTagSubItemDefinition("NameAndAddress", "Name And Address");
      MT456.U0010.Elements.Add((SwiftDefinitionElement) MT456.U0012);
      MT456.U0004.Elements.Add((SwiftDefinitionElement) MT456.U0010);
      MT456.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT456.U0004);
      MT456.U0013 = new SwiftTagDefinition("SenderToReceiverInformation_72", "Sender To Receiver Information");
      MT456.U0013.TagName = ":72:";
      MT456.U0013.Mandatory = false;
      MT456.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT456.U0013);
      MT456.U0014 = new SwiftTagSequenceDefinition("Sequence", "Transaction Reference Number");
      MT456.U0014.Multiple = true;
      MT456.U0015 = new SwiftTagDefinition("TransactionReferenceNumber_20", "Transaction Reference Number");
      MT456.U0015.TagName = ":20:";
      MT456.U0016 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT456.U0015.Elements.Add((SwiftDefinitionElement) MT456.U0016);
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0015);
      MT456.U0017 = new SwiftTagDefinition("RelatedReference_21", "Related Reference");
      MT456.U0017.TagName = ":21:";
      MT456.U0018 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT456.U0017.Elements.Add((SwiftDefinitionElement) MT456.U0018);
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0017);
      MT456.U0019 = new SwiftTagChoiceDefinition("Choice", "");
      MT456.U0019.Multiple = true;
      MT456.U001A = new SwiftTagDefinition("DateAndFaceAmountOfFinancialDocument_32A", "Date And Face Amount Of Financial Document");
      MT456.U001A.TagName = ":32A:";
      MT456.U001B = new SwiftTagSubItemDefinition("Date", "Date");
      MT456.U001A.Elements.Add((SwiftDefinitionElement) MT456.U001B);
      MT456.U001C = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT456.U001A.Elements.Add((SwiftDefinitionElement) MT456.U001C);
      MT456.U001D = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT456.U001A.Elements.Add((SwiftDefinitionElement) MT456.U001D);
      MT456.U0019.Elements.Add((SwiftDefinitionElement) MT456.U001A);
      MT456.U001E = new SwiftTagDefinition("DateAndFaceAmountOfFinancialDocument_32B", "Date And Face Amount Of Financial Document");
      MT456.U001E.TagName = ":32B:";
      MT456.U001F = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT456.U001E.Elements.Add((SwiftDefinitionElement) MT456.U001F);
      MT456.U007F = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT456.U001E.Elements.Add((SwiftDefinitionElement) MT456.U007F);
      MT456.U0019.Elements.Add((SwiftDefinitionElement) MT456.U001E);
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0019);
      MT456.U0080 = new SwiftTagDefinition("TotalAmountDebited_33D", "Total Amount Debited");
      MT456.U0080.TagName = ":33D:";
      MT456.U0081 = new SwiftTagSubItemDefinition("Date", "Date");
      MT456.U0080.Elements.Add((SwiftDefinitionElement) MT456.U0081);
      MT456.U0082 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT456.U0080.Elements.Add((SwiftDefinitionElement) MT456.U0082);
      MT456.U0083 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT456.U0080.Elements.Add((SwiftDefinitionElement) MT456.U0083);
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0080);
      MT456.U0084 = new SwiftTagDefinition("Fee_71B", "Fee");
      MT456.U0084.TagName = ":71B:";
      MT456.U0084.Mandatory = false;
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0084);
      MT456.U0086 = new SwiftTagDefinition("ReasonForDishonour_77A", "Reason for Dishonour");
      MT456.U0086.TagName = ":77A:";
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0086);
      MT456.U0087 = new SwiftTagDefinition("DetailsOfDishonouredItem_77D", "Details Of Dishonoured Item");
      MT456.U0087.TagName = ":77D:";
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0087);
      MT456.U0088 = new SwiftTagDefinition("SenderToReceiverInformation_72", "Sender To Receiver Information");
      MT456.U0088.TagName = ":72:";
      MT456.U0088.Mandatory = false;
      MT456.U0014.Elements.Add((SwiftDefinitionElement) MT456.U0088);
      MT456.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT456.U0014);
    }

    public class SequenceClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT456.U0014;
        }
      }

      [Description("Transaction Reference Number")]
      public Tag20 TransactionReferenceNumber_20
      {
        get
        {
          return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0015);
        }
      }

      [Description("Transaction Reference Number")]
      public Tag20 Tag20_TransactionReferenceNumber
      {
        get
        {
          return this.TransactionReferenceNumber_20;
        }
      }

      [Description("Related Reference")]
      public Tag21 RelatedReference_21
      {
        get
        {
          return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0017);
        }
      }

      [Description("Related Reference")]
      public Tag21 Tag21_RelatedReference
      {
        get
        {
          return this.RelatedReference_21;
        }
      }

      [Description("Date And Face Amount Of Financial Document")]
      public Tag32A DateAndFaceAmountOfFinancialDocument_32A
      {
        get
        {
          return new Tag32A((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U001A);
        }
      }

      [Description("Date And Face Amount Of Financial Document")]
      public Tag32A Tag32A_DateAndFaceAmountOfFinancialDocument
      {
        get
        {
          return this.DateAndFaceAmountOfFinancialDocument_32A;
        }
      }

      [Description("Date And Face Amount Of Financial Document")]
      public Tag32B DateAndFaceAmountOfFinancialDocument_32B
      {
        get
        {
          return new Tag32B((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U001E);
        }
      }

      [Description("Date And Face Amount Of Financial Document")]
      public Tag32B Tag32B_DateAndFaceAmountOfFinancialDocument
      {
        get
        {
          return this.DateAndFaceAmountOfFinancialDocument_32B;
        }
      }

      [Description("Total Amount Debited")]
      public Tag33D TotalAmountDebited_33D
      {
        get
        {
          return new Tag33D((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0080);
        }
      }

      [Description("Total Amount Debited")]
      public Tag33D Tag33D_TotalAmountDebited
      {
        get
        {
          return this.TotalAmountDebited_33D;
        }
      }

      [Description("Fee")]
      public Tag71B Fee_71B
      {
        get
        {
          return new Tag71B((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0084);
        }
      }

      [Description("Fee")]
      public Tag71B Tag71B_Fee
      {
        get
        {
          return this.Fee_71B;
        }
      }

      [Description("Reason for Dishonour")]
      public Tag77A ReasonForDishonour_77A
      {
        get
        {
          return new Tag77A((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0086);
        }
      }

      [Description("Reason for Dishonour")]
      public Tag77A Tag77A_ReasonForDishonour
      {
        get
        {
          return this.ReasonForDishonour_77A;
        }
      }

      [Description("Details Of Dishonoured Item")]
      public Tag77D DetailsOfDishonouredItem_77D
      {
        get
        {
          return new Tag77D((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0087);
        }
      }

      [Description("Details Of Dishonoured Item")]
      public Tag77D Tag77D_DetailsOfDishonouredItem
      {
        get
        {
          return this.DetailsOfDishonouredItem_77D;
        }
      }

      [Description("Sender To Receiver Information")]
      public Tag72 SenderToReceiverInformation_72
      {
        get
        {
          return new Tag72((SwiftElement) this, 0, (SwiftDefinitionElement) MT456.U0088);
        }
      }

      [Description("Sender To Receiver Information")]
      public Tag72 Tag72_SenderToReceiverInformation
      {
        get
        {
          return this.SenderToReceiverInformation_72;
        }
      }

      internal SequenceClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }
    }
  }
}
